<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>注册 - {$webinfo.webname}</title>
    <meta name="keywords"
          content="{$webinfo.webname},微信公众号,微信公众号商城,小程序商城,小程序分销系统,小程序在线制作,小程序,微信小程序,小程序制作,微信小程序制作,小程序工具,微信小程序工具,小程序开发,微信小程序开发,小程序平台,微信小程序平台"/>
    <meta name="description"
          content="{$webinfo.webname}-微信公众号微信小程序商城及分销解决方案，致力于为广大商家快速搭建自己的微信公众号微信小程序，围绕会员、营销、效率，助力商家轻松经营店铺。"/>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta name="Renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="Pragma" content="no-cache">
    <!-- HTTP 1.0 -->
    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
    <!-- Prevent caching at the proxy server -->
    <meta http-equiv="Expires" content="0">
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9"/>
    <!-- Mobile Metas -->
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0,user-scalable=no,maximum-scale=1.0,minimum-scale=1.0">
    <meta http-equiv="Cache-Control" content="no-transform"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    {if $webinfo.ico}
    <link rel="shortcut icon" type="image/x-icon" href="{$webinfo.ico}"/>
    {/if}
    <link rel="stylesheet" href="/static/index/css/index.css?v=1015">
    <link rel="stylesheet" href="/static/index/css/login.css">
    <link rel="stylesheet" href="/static/admin/layui/css/layui.css">

</head>
<body>
<div class="toptab">
    {include file="index/public/menu"/}
</div>
<div style="width:100%;height:80px;line-height:80px;border:0;padding:0;margin:0"></div>

<!-- #03152A #2E241B #50314F #344058 #20222A  -->
<div class="layadmin-user-login layadmin-user-display-show" id="LAY-user-login"
     style="background:linear-gradient(#acc6e1, #ffffff);">
    {if $reg_open}
    <div class="layadmin-user-login-main" bgimg style="position:relative">
        <div class="layadmin-user-login-box layadmin-user-login-header" style="padding-bottom:0">
            <h2>用户注册</h2>
            <!-- <p>{$setdata.adminregsubtitle}</p> -->
        </div>
        <div class="layadmin-user-login-box layadmin-user-login-body layui-form">
            <input type="hidden" name="fromkeyword" value="{$_GET['fromkeyword']}"/>
            <div class="layui-form-item">
                <label class="layadmin-user-login-icon layui-icon layui-icon-username"
                       for="LAY-user-login-username"></label>
                <input type="text" name="username" id="LAY-user-login-username" lay-verify="required|username" placeholder="手机号码"
                       class="layui-input" value="" autocomplete="off">
            </div>
            <div class="layui-form-item">
                <label class="layadmin-user-login-icon layui-icon layui-icon-password"
                       for="LAY-user-login-password"></label>
                <input type="password" name="password" id="LAY-user-login-password" lay-verify="required|pass" placeholder="登录密码"
                       class="layui-input" value="" autocomplete="off">
            </div>
            <div class="layui-form-item">
                <label class="layadmin-user-login-icon layui-icon layui-icon-password"
                       for="LAY-user-login-repassword"></label>
                <input type="password" name="repassword" id="LAY-user-login-repassword" lay-verify="required|repassword"
                       placeholder="确认密码" class="layui-input" value="" autocomplete="off">
            </div>
            <div class="layui-form-item">
                <div class="layui-row">
                    <div class="layui-col-xs7">
                        <label class="layadmin-user-login-icon layui-icon layui-icon-vercode" for="LAY-user-login-vercode"></label>
                        <input type="text" name="captcha" id="LAY-user-login-vercode" lay-verify="required" placeholder="图形验证码" class="layui-input">
                    </div>
                    <div class="layui-col-xs5">
                        <div style="margin-left: 10px;">
                            <img src="{:captcha_src()}" class="layadmin-user-login-codeimg" id="LAY-user-get-vercode">
                        </div>
                    </div>
                </div>
            </div>
            {if $sms_open}
            <div class="layui-form-item">
                <div class="layui-row">
                    <div class="layui-col-xs7">
                        <label class="layadmin-user-login-icon layui-icon layui-icon-vercode"
                               for="LAY-user-login-vercode"></label>
                        <input type="text" name="smscode" id="LAY-user-login-vercode" lay-verify="required"
                               placeholder="短信验证码" class="layui-input">
                    </div>
                    <div class="layui-col-xs5" style="text-align:right">
                        <button class="layui-btn layui-btn-primary" onclick="sendsms(this)">获取验证码</button>
                    </div>
                </div>
            </div>
            {/if}
            {if $webinfo.reg_user_agreement_url}
            <div class="layui-form-item" style="display: flex;">
                <input type="checkbox" name="xieyi" value="1" lay-skin="primary" title="" checked>
                <div style="margin-top:8px;color:#888">已阅读并同意<a href="{$webinfo.reg_user_agreement_url}" target="_blank">《用户注册协议》</a></div>
            </div>
            {/if}
            <div class="layui-form-item" style="margin-bottom: 20px;">
                <div onclick="location.href='/admin.php'" class="layadmin-user-jump-change layadmin-link" style="margin-top: 7px; cursor: pointer;">已有账号？点击登录</div>
                <!-- <a href="forget.html" class="layadmin-user-jump-change layadmin-link" style="margin-top: 7px;">忘记密码？</a> -->
            </div>
            <div class="layui-form-item">
                <button class="layui-btn layui-btn-fluid layui-btn-normal" lay-submit lay-filter="LAY-user-login-submit"
                        id="regbtn">立即注册
                </button>
            </div>
        </div>
    </div>
  {else}
  <div class="reg-close">注册关闭，请联系客服</div>
  {/if}
</div>

{include file="index/public/js"/}
<script>
    $(function(){
        $('#LAY-user-get-vercode').click(function(){
            this.src = '{:captcha_src()}&t='+ new Date().getTime();
        })
    });

    var form = layui.form
    form.verify({
        username: [/^1[0-9]{10}$/, '请输入正确的手机号'],
        pass: [/^[\S]{6,12}$/, '密码必须6到12位，且不能出现空格'],
        repassword: function (value, item) {
            if($('input[name=password]').val() !== value)
                return '两次密码输入不一致！';
        }
    })
    layui.form.on('submit(LAY-user-login-submit)', function (obj) {
        var field = obj.field;
        {if $webinfo.reg_user_agreement_url}
        if (!field.xieyi) {
            dialog('请阅读并同意注册协议');
            return;
        }
        {/if}
        $.post("{:url('reg')}", obj.field, function (data) {
            if(data.status==0){
                $('#LAY-user-get-vercode').attr('src','{:captcha_src()}&t='+ new Date().getTime());
            }
            dialog(data.msg, data.status, data.url)
        })
    })
    var hqing = 0;

    function sendsms(obj) {
        var tel = $("input[name=username]").val();
        if (!tel || !(/^1[0-9]{10}$/.test(tel))) {
            dialog('请输入正确的手机号');
            return;
        }
        var password = $("input[name=password]").val();
        var captcha = $("input[name=captcha]").val();
        if (hqing) return;
        hqing = 1;
        $.post("{:url('reg')}&op=sendsms", {username: tel, password: password, captcha: captcha}, function (data) {
            if (data.status != 1) {
                hqing = 0;
                dialog(data.msg);
            } else {
                var time = 120;
                var t = setInterval(function () {
                    time--;
                    if (time < 0) {
                        $(obj).html("重新获取");
                        hqing = 0;
                        clearInterval(t);
                    } else if (time >= 0) {
                        $(obj).html(time + "秒");
                    }
                }, 1000);
            }
        });

    }
</script>
<div class="bottomtip">
    <div class="f1">{$webinfo.webname}&nbsp;&nbsp;&nbsp;易用可靠的全能商城</div>
    <div class="btn1" onclick="location.href='{:url('lianxi')}'">立即咨询</div>
</div>

<div class="bottombox">
    <div class="f1">
        <a href="/">首页</a>
        <a href="{:url('funshow')}">功能介绍</a>
        <a href="{:url('lianxi')}">联系我们</a>
        <a href="{:url('help')}">帮助中心</a>
    </div>
    <div class="f2">
        {$webinfo.copyright}&nbsp;&nbsp;&nbsp;<a href="http://beian.miit.gov.cn/" target="_blank" style="color:#6B798E">{$webinfo.beian}</a>
    </div>
</div>

</body>
</html>